/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fr.cggveritas.crewintranet.jms.managedBeans.gestionVehicule;

import fr.cggveritas.crewintranet.jms.dao.jpacontroller.CvVehiculeJpaController;
import fr.cggveritas.crewintranet.jms.entities.CvVehicule;
import fr.cggveritas.crewintranet.jms.managedBeans.utils.RedirectionPage;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.bean.SessionScoped;

/**
 *
 * @author Alassane
 */
@ManagedBean(name = "vehiculeBean")
@RequestScoped
public class VehiculeBean implements Serializable {

    /**
     * Creates a new instance of VehiculeBean
     */
    private CvVehiculeJpaController cvVehiculeJpaController;
    private CvVehicule cvVehiculeSelectionner;
    private List<CvVehicule> filterListCvVehicules;
    private List<CvVehicule> listCvVehicules;

    public VehiculeBean() {
        cvVehiculeJpaController = new CvVehiculeJpaController();
        cvVehiculeSelectionner = new CvVehicule();
        filterListCvVehicules = new ArrayList<CvVehicule>();
        listCvVehicules = new ArrayList<CvVehicule>();
        listCvVehicules = cvVehiculeJpaController.findCvVehiculeEntities();
        filterListCvVehicules = listCvVehicules;
    }
    
    public String pageModificationInfos(){
        
        return RedirectionPage.redirectionEditerVehicule;
    }
    public void enregistrerLesModification(){
        
    }
    public List<CvVehicule> getListCvVehicules() {
        listCvVehicules = cvVehiculeJpaController.findCvVehiculeEntities();
        return listCvVehicules;
    }

    public void setListCvVehicules(List<CvVehicule> listCvVehicules) {
        this.listCvVehicules = listCvVehicules;
    }

    public CvVehiculeJpaController getCvVehiculeJpaController() {
        return cvVehiculeJpaController;
    }

    public void setCvVehiculeJpaController(CvVehiculeJpaController cvVehiculeJpaController) {
        this.cvVehiculeJpaController = cvVehiculeJpaController;
    }

    public CvVehicule getCvVehiculeSelectionner() {
        return cvVehiculeSelectionner;
    }

    public void setCvVehiculeSelectionner(CvVehicule cvVehiculeSelectionner) {
        this.cvVehiculeSelectionner = cvVehiculeSelectionner;
    }

    public List<CvVehicule> getFilterListCvVehicules() {
        return filterListCvVehicules;
    }

    public void setFilterListCvVehicules(List<CvVehicule> filterListCvVehicules) {
        this.filterListCvVehicules = filterListCvVehicules;
    }
}
